import request from './index';

interface LoginParams {
    account: string;
    password: string;
    code: string;
}

export function login(data: LoginParams): Promise<RD> {
    return request.post('/login', {
        data,
    });
}

export function logout() {
    return request.post('/logout', {
        params: {
            encode: true,
        },
    });
}

/** 获取验证码 */
export function fetchCaptcha() {
    return request.get('/captcha', {
        params: {
            encode: true,
        },
    });
}
